import { Prettify } from "@/types/global";
import { cva, type VariantProps } from "class-variance-authority";
import { ButtonHTMLAttributes } from "react";

const buttonClasses = cva('px-6 font-medium border rounded-full justify-center items-center', {
    variants: {
        variant: {
            primary: 'bg-lime-400 text-neutral-950 border-lime-400',
            secondary: 'bg-transparent text-white border-white',
        },
        size: {
            sm: 'h-10',
            md: 'h-12',
        },
    },
    defaultVariants: {
        size: 'md',
    },
});

export default function Button(props: Prettify<VariantProps<typeof buttonClasses> & ButtonHTMLAttributes<HTMLButtonElement>>) {
    const { variant, className, size, ...otherProps } = props;

    return (
        <button className={buttonClasses({ variant, className, size })} {...otherProps}></button>
    );
};